Skip to content

test: refine replacement property strategy#206

Closed
rlippmann wants to merge 2 commits into
mainfrom
codex/replacement-property-followup
Closed

test: refine replacement property strategy#206
rlippmann wants to merge 2 commits into
mainfrom
codex/replacement-property-followup

Conversation

@rlippmann

Copy link
Copy Markdown
Owner

What changed

  • refine the Hypothesis replacement-case strategy in tests/test_properties.py so generated deterministic replacement scenarios directly produce the authoritative initial state under test
  • simplify the replacement property to compare the replacement directive against equivalent explicit public operations on that same generated initial state
  • preserve coverage for old source present/absent, unrelated premise and policies, and normalization-sensitive item identities without mutating the generated state inside the test body

Why

  • the prior property rewrote the generated payload before asserting, which made the invariant harder to reason about
  • generating the actual state under test makes the property closer to the intended contract: replacement should match the equivalent explicit transition sequence from the same authoritative starting state

Checklist

  • pre-commit run (uv run pre-commit run --all-files)
  • tests pass (uv run pytest)

@rlippmann
rlippmann marked this pull request as ready for review July 24, 2026 07:58
@rlippmann rlippmann closed this Jul 25, 2026
@rlippmann
rlippmann deleted the codex/replacement-property-followup branch July 25, 2026 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant